<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>


<h1>1. forEach</h1>
<h3>1.1 固定次数循环</h3>
<table>
<tr><td>index</td><td>count</td><td>first</td><td>end</td><td>current</td></tr>
<c:forEach begin="0" end="20" step="2" varStatus="status">
	<tr>
	<td>${status.index}</td>
	<td>${status.count}</td>
	<td>${status.first}</td>
	<td>${status.last}</td>
	<td>${status.current}</td>
	</tr>
</c:forEach>
</table>
<br/>

<h3>1.2 容器</h3>
<%
	String[] names = {"张三","李四","王五","赵六"};
	request.setAttribute("names",names);
%>
<c:forEach items="${names}" var="name">
	${name}
</c:forEach>

<h1>2. forToken</h1>

<c:set var="languages" value="c#,c++,java,Python"></c:set>

<c:forTokens items="${languages}" delims="," var="lan">
	${lan}<br />
</c:forTokens>


</body>
</html>